<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
	<head>
		<title>JavaScript unit test file</title>
		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
		<link rel="stylesheet" href="unittest.css" type="text/css" />
		<script src="jsunittest.js" type="text/javascript"></script>
		<script src="jscontext.js" type="text/javascript"></script>

		<script src="../lib/html_matcher.js" type="text/javascript"></script>
	</head>
	<body>
		<div id="content">
			<div id="header">
				<h1>Zen Coding's pair matcher</h1>
			</div>
			<!-- Log output (one per Runner, via {testLog: "testlog"} option)-->
			<div id="testlog"></div>

			<!-- Put sample/test html here -->
			<div id="sample"></div>
		</div>
		<script type="text/javascript">
			var xhtml_string = '<p><strong>Hello</strong> world <br /> to all <img src="/path/to/image.png" alt="" /> my <!-- enemies --> friends</p>';
			var html_string = '<p><b>Hello</b> world <br> to all <img src="/path/to/image.png" alt=""> my friends<p>Another paragraph';
			
			new Test.Unit.Runner({
				"test XHTML": function(){ with (this) {
					assertEnumEqual([11, 16], HTMLPairMatcher(xhtml_string, 12));
					assertEnumEqual([3, 25], HTMLPairMatcher(xhtml_string, 8));
					assertEnumEqual([32, 38], HTMLPairMatcher(xhtml_string, 36));
					assertEnumEqual([46, 85], HTMLPairMatcher(xhtml_string, 70));
					assertEnumEqual([3, 113], HTMLPairMatcher(xhtml_string, 43));
					assertEnumEqual([89, 105], HTMLPairMatcher(xhtml_string, 99));
				 }},
				"test HTML": function(){ with (this) {
					assertEnumEqual([22, 26], HTMLPairMatcher(html_string, 25));
				 }}
			});
		</script>
	</body>
</html>
